package com.nbsaas.boot.data.rest.resource;

import com.nbsaas.boot.data.api.apis.QueryTemplateHistoryApi;
import com.nbsaas.boot.data.data.entity.QueryTemplateHistory;
import com.nbsaas.boot.data.api.domain.request.QueryTemplateHistoryRequest;
import com.nbsaas.boot.data.api.domain.response.QueryTemplateHistoryResponse;
import com.nbsaas.boot.data.api.domain.simple.QueryTemplateHistorySimple;
import com.nbsaas.boot.data.rest.convert.QueryTemplateHistorySimpleConvert;
import com.nbsaas.boot.data.rest.convert.QueryTemplateHistoryEntityConvert;
import com.nbsaas.boot.data.rest.convert.QueryTemplateHistoryResponseConvert;
import com.nbsaas.boot.data.data.repository.QueryTemplateHistoryRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   sql历史-业务接口实现
*/
@Transactional
@Service
public class QueryTemplateHistoryResource extends BaseResource<QueryTemplateHistory,QueryTemplateHistoryResponse, QueryTemplateHistorySimple, QueryTemplateHistoryRequest>  implements QueryTemplateHistoryApi {

    @Resource
    private QueryTemplateHistoryRepository queryTemplateHistoryRepository;

    @Override
    public JpaRepositoryImplementation<QueryTemplateHistory, Serializable> getJpaRepository() {
        return queryTemplateHistoryRepository;
    }

    @Override
    public Function<QueryTemplateHistory, QueryTemplateHistorySimple> getConvertSimple() {
        return new QueryTemplateHistorySimpleConvert();
    }

    @Override
    public Function<QueryTemplateHistoryRequest, QueryTemplateHistory> getConvertForm() {
        return new QueryTemplateHistoryEntityConvert();
    }

    @Override
    public Function<QueryTemplateHistory, QueryTemplateHistoryResponse> getConvertResponse() {
        return new QueryTemplateHistoryResponseConvert();
    }




}


